0) { $extname = substr($passfile,strpos($passfile,".")); $lookforfile = substr($passfile,0,strpos($passfile,".")) . "_thmb" . $extname; // echo "lookforfile = $lookforfile"; $aptr = 0; while ($aptr < $dami) { if ($dirarray[$aptr]==$lookforfile) $passptr = $aptr + 1; $aptr++; }; }; // convert the passptr to base 0 because arrays are based on 0 $base0ptr = $passptr - 1; $thmbfile = "details/" . $wpt . "/" . $dirarray[$base0ptr]; //$imgfile = substr($thmbfile,0,strpos($thmbfile,"_")) . ".jpg"; $imgfile = substr($thmbfile,0,strpos($thmbfile,"_")) . substr($thmbfile,strpos($thmbfile,".")); $descfile = substr($thmbfile,0,strpos($thmbfile,"_")) . ".html"; //echo "imgfile=$imgfile"; echo ""; echo ""; echo "
"; echo "$row[description]"; if (strlen($passfile) > 0) $nartarget=$passfile; else $nartarget = substr($dirarray[$base0ptr],0,strlen($dirarray[$base0ptr])-9).".jpg"; // extract the file two digit //echo "nartarget = $nartarget"; $nresult=mysql_query("select * from narratives where nartarget=\"$nartarget\""); $ndami = mysql_num_rows($nresult); if ($ndami>0) { $nrow=mysql_fetch_array($nresult); echo "$nrow[narrative]"; }; if (!empty($dami)) { // $onedigitptr = sprintf("%01d",$passptr); echo "

Photo $passptr of $dami
"; if ($passptr > 1) { $prevptr = $passptr - 1; // $prevptr = sprintf("%02d",$prevptr); echo "<<prev | "; }; echo "narratives"; if ($passptr < $dami) { $nextptr = $passptr + 1; // $nextptr = sprintf("%02d",$nextptr); echo " | next>> "; }; echo "

"; }; // $thmbfile = "$dirarray[$base0ptr]; $imgfilename = substr($dirarray[$base0ptr],0,strpos($dirarray[$base0ptr],"_")) . ".jpg"; // $imgfilename = $wpt . $ptr . ".jpg"; $result=mysql_query("select * from contributions left join contributors using (conid) where confilename=\"$imgfilename\""); if ($row=mysql_fetch_array($result)) { if ($row[conyear]>0) $conyear= "(" . $row[conyear] . ")"; if (strlen(trim($row[conpenname]))>0) $signature=$row[conpenname]; else $signature=$row[conname]; echo "

© Photo by: $signature  $conyear"; } else { echo "

© Photo by: (not yet credited)"; }; echo "
All Rights Reserved

"; echo "
"; ?>